/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.amuthu.expression.function.indicator;

import org.amuthu.DataStore;
import org.amuthu.expression.Expression;
import org.amuthu.indicator.PDI;
import org.amuthu.parser.ExpressionVisitor;

/**
 * pdi(period,startOffset)
 * @author prabhu
 */
public class PlusDirectionalIndexFunction extends PeriodOffsetFunction
{
   public PlusDirectionalIndexFunction()
   {
   }

   @Override
   public double calculateIndicator(DataStore dataStore, Expression[] arguments, ExpressionVisitor visitor)
   {
      PDI pdi = new PDI(dataStore, getPeriod(), getOffset());

      return pdi.calculate();
   }

   @Override
   public int calculateDependency(DataStore dataStore, Expression[] arguments, ExpressionVisitor visitor)
   {
      PDI pdi = new PDI(dataStore, getPeriod(), getOffset());

      return pdi.getDayDependency();
   }

}
